package com.zhiyou100.servicrImpl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.zhiyou100.mapper.drug.DrugMapper;
import com.zhiyou100.model.Drug;
import com.zhiyou100.service.DrugService;
@Service
public class DrugServiceImpl implements DrugService{
	@Autowired
	private DrugMapper mapper;
	// 查询
	@Override
	public List<Drug> findAll(Map<String, Object> map) {
		List<Drug> drug = mapper.findAll(map);
		return drug;
	}
	// 详情
	@Override
	public Drug detailById(String drug_num) {
		Drug drug = mapper.detailById(drug_num);
		return drug;
	}
	// 添加
	@Override
	public void addDrug(Drug drug) {
		mapper.addDrug(drug);
		
	}
	//更新
	@Override
	public Drug findToEdit(String drug_num) {
		Drug drug = mapper.findToEdit(drug_num);
		return drug;
	}
	@Override
	public void updateById(Drug drug) {
		mapper.updateById(drug);
		
	}

}
